// pages/orgbillDetail/orgbillDetail.js
var app = getApp();
const util = require("../../utils/util.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    orgid:'',
    id:'',
    item:{},
    payType:''
  },
getdetail(){
  var that = this
  app.req({
    url: "orgmini/orgAccount/getOrgAccountBillDetail",
    data: {
      orgId: that.data.orgid,
      id:that.data.id
    },
    method: "post",
    success: function (res) {
      if(res.code==200){
        wx.setNavigationBarTitle({
          title: res.data.orgName
        })
        res.data.createTime =res.data.createTime.substring(0, 16)
        res.data.actStartTime = res.data.actStartTime.substring(0, 16)
        res.data.checkTime = res.data.checkTime.substring(0, 16)
        console.log(that.data.payType)
        if (that.data.payType==5){
          res.data.payType=5
        }
        console.log(res.data)
        that.setData({
          item:res.data
        })

      }
    }
  })
},
  topage: function (e) {
    var that = this;
    var id = e.currentTarget.dataset.id;
    var name = e.currentTarget.dataset.name;
    wx.navigateTo({
      url: '/pages/myCardNew/myCardNew?type=visitor&id=' + id + '&name=' + name,
    })
  },
  toorghome(e){
    var dataset = e.currentTarget.dataset
    wx.navigateTo({
      url: '/pages/orgHome/orgHome?id=' + dataset.orgid
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      orgid:options.orgid,
      id:options.id,
      payType: options.paytype
    })
    console.log(options.paytype)
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.getdetail()
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})